package clases;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class MainClass {

	
	public static void main(String[] args) {
		Pattern pattern = Pattern.compile("foo");
		Matcher matcher = pattern.matcher("A buscar foo aqui!");

		while( matcher.find() ){
			System.out.println("Encontre ́"+ matcher.group() + " comenzando en"
					+ matcher.start() + " y terminando en " + matcher.end());
		}
			System.out.println("Fin de busqueda");
             //  match mail "\\w+@\\w+(\\.\\w+)+"
	}

}
